package com.lagou.rpc.service.impl;

import com.lagou.rpc.service.UserService;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service("userService")
public class UserServiceImpl implements UserService {

    private int port;

    public void setPort(int port) {
        this.port = port;
    }

    public String say(String word) {
        try {
            Thread.sleep(new Random().nextInt(1000));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "调用成功--参数:" + word + ",port:" + port;
    }
}
